<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
 li:nth-of-type(3){background-color: red;}
 li:first-of-type{background-color: royalblue;}
 li:last-of-type{background-color: seagreen;}
 /* li:only-of-type{background-color: tomato;}     非唯一不会有效果 */
    </style>
</head>
<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>
</html>